<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html" 
      >
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel =" stylesheet" href="${request.contextPath}/content/styles/main.css"/>
        <title><ui:insert name="title">Default Title</ui:insert></title>
    </h:head>

    <h:body>
        <div id ="nav">            
            <span class ="navlink"><h:outputLink value="${request.contextPath}" >Home</h:outputLink></span>
            <h:panelGroup rendered="#{userController.isUserLoggedIn()}">
            <span class ="navlink"><h:link outcome="profile" value ="Profile"/></span>
            </h:panelGroup>
            <h:panelGroup rendered="#{userController.isUserLoggedIn()}">
            <span class ="navlink">
                <h:link outcome="createQuiz" value ="Create Quiz"/>
            </span>
            </h:panelGroup>            
            <h:panelGroup rendered="#{!userController.isUserLoggedIn()}">
            <span class ="navlink loginlink">
                <h:link outcome="login" value ="Log me in"/>
            </span>
            </h:panelGroup>
            <h:panelGroup  rendered="#{userController.isUserLoggedIn()}">
                <span class ="navlink loginlink">
                    <h:form>
                    <h:commandLink value ="Log out" action ="#{userController.logout()}"/>
                    </h:form>
                </span>
            </h:panelGroup>
        </div>
        <div id ="pageContent">
            <ui:insert name="body">Default Body</ui:insert>
        </div>
    </h:body>

</html>
